#include<iostream>
#include<vector>
#include<cstring>
using namespace std;
const int N = 2e5 + 10;
int a[N];
int n;
vector<int>ans1, ans2;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(a, 0, sizeof(a));
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
		}
		ans1.clear();
		ans2.clear();
		for (int i = 1; i <= n; i++) {
			//cout<<a[i]<<endl;
			if (!ans1.size() || ans1.back() <= a[i]) {
				ans1.push_back(a[i]);
				cout << 1;
			}
			else if (ans1[0] >= a[i]) {
				if (!ans2.size() || ans2.back() <= a[i]) {
					ans2.push_back(a[i]);
					cout << 1; 
				}
				else cout << 0;
			}
			else if (ans1[0] < a[i] && a[i] < ans1.back()) {
				cout << 0;
			}
			//else cout << 0;
		}
		cout << endl;
	}
	return 0;
}